package com.qiche.service;

import com.github.pagehelper.PageInfo;
import com.qiche.aspect.Result;
import com.qiche.dto.SimpleMemberDto;
import com.qiche.dto.StoreMemberDto;
import com.qiche.model.StoreMember;
import com.qiche.model.User;
import com.qiche.param.StoreMemberParam;
import com.qiche.vo.StoreMemberVo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;

/**
 * @author chendezhi
 * @date 2018/3/28 17:00
 */
public interface StoreMemberService extends IService<StoreMember> {

    PageInfo<StoreMemberVo> selectStoreMemberWithCarsByPage(StoreMemberParam param, int start, int length);

    StoreMember selectByPhoneAndMerchantId(String phone,Integer merchantId);

    StoreMember selectByOpenidUnionidMerchantid(String openid, String unionId,Long merchantId);
    
    StoreMember selectByOpenidMerchantid( String openid,Long merchantId);

    Result<StoreMemberVo> saveStoreMember(StoreMemberDto storeMemberDto);

    Result delStoreMember(Long id);

    Result analysisAndImport(String path);

    Result downloadTemplate(HttpServletRequest request, HttpServletResponse response);

    List<StoreMember> selectByMerchantId();

    int countByTimeRange(Integer merchantId, Date startTime, Date endTime);

    PageInfo<SimpleMemberDto> searchByPhoneOrNameOrCarNum(String keyword, User currentUser, int pageNum, int pageSize);
}
